package be.kdg.netpresent;

import java.io.Serializable;

public class QnA implements Serializable {

	// Default serial ID
	private static final long serialVersionUID = 1L;
	
	// String that holds a question asked on a slide.
	private String question;
	
	// String that holds the answer to the question above.
	private String answer;
	
	// An instance of this class is created upon a qustion being asked.
	// So the question is set upon creation of the instance and the answer
	// keeps empty for now.
	public QnA(String question) {
		this.question = question;
		this.answer = "";
	}
	
	// Separate method to set the answer-string of this instance.
	public void addAnswer(String answer) {
		this.answer = answer;
	}
	
	// This method returns the containing information as a preformatted string.
	public String getQnA() {
		String tmp = "Q: " + this.question;
		if (!answer.equals("")) {
			tmp += "\nA: " + this.answer;
		}
		return tmp;
	}
}
